﻿namespace MicroScheduleServer.Dtos;

public class Job
{
    public string UUID { get; set; }
    public string Name { get; set; }
    public string Remark { get; set; }

    public DateTime StartTime { get; set; }
    public Trigger Trigger { get; set; }

    #region http
    public string HttpUrl { get; set; }
    public EnumHttpMethod HttpMethod { get; set; }
    public Dictionary<string, string> HttpHeaders { get; set; }
    #endregion
}

public class Trigger
{
    public string UUID { get; set; }
    public string Name { get; set; }
    public string Remark { get; set; }

    public EnumTriggerType TriggerType { get; set; }

    #region Interval 类型
    public int Interval { get; set; }
    public bool WaitForLastEnd { get; set; }
    #endregion

    #region Repeat 类型
    public int LoopFrequency { get; set; }
    public List<LoopFilter> LoopFilters { get; set; }
    public class LoopFilter
    {
        public EnumProperty Property { get; set; }
        public EnumOpType OpType { get; set; }
        public string Value { get; set; }
    }
    #endregion
}

public class JobDto
{

}
